/*    
 * Copyright (c) 2013 ISoftStone, Inc.
 * All right reserved.
 *
 * 文件名：      Startup.java
 * 作者:     Jacky Wang
 * 创建日期： 2013-7-24 下午02:33:03
 * 版本：           
 *
 */
package com.isoftstone.industry.aaa.startup;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.isoftstone.industry.common.context.BeanFactory;

/**
 * AAAServer入口
 * @author jacky
 */
public class Startup
{
	private static final Logger logger = Logger.getLogger(Startup.class);
	
	private ApplicationContext context;

	public ApplicationContext getContext()
	{
		return context;
	}

	public void setContext(ApplicationContext context)
	{
		this.context = context;
	}
	
	public static void main(String[] args)
	{
		Startup startup = new Startup();
		ApplicationContext _context = new ClassPathXmlApplicationContext("/spring/applicationContext-*.xml");
		startup.setContext(_context);
		BeanFactory.getInstance().setContext(_context);
		//启动RMI服务
		logger.info("启动RMI服务...");
		_context.getBean("aaaServiceRmi");
		//启动定时器
		logger.info("启动定时器...");
		_context.getBean("startQuartz");
		logger.info("AAAServer启动成功...");
	}

}
